/*
 * Model.h
 *
 *  Created on: 2011/07/28
 *      Author: naoki
 */

#ifndef INCLUDED_NTENGINE_SCENE_MODEL_H
#define INCLUDED_NTENGINE_SCENE_MODEL_H

namespace NTEngine {
namespace Math {
	class Vector3;
	class Vector4;
} // namespace Math

namespace Scene {
class Batch;

/**
 * @brief 描画インスタンス
 * 行列を渡してdrawすれば絵が出るが、動かしたり色を変えたりもできる。
 */
class Model {
public:
	///描画
	void draw() const;

	const Math::Vector3* position() const;
	const Math::Vector3* angle() const; //単位は度
	const Math::Vector3* scale() const;
	const Math::Vector3* color() const;
	float transparency() const;
	void setPosition( const Math::Vector3& );
	void setAngle( const Math::Vector3& ); //単位は度
	void setScale( const Math::Vector3& );
	void setColor( const Math::Vector3& );
	void setTransparency( float );

	Model();
	~Model();
	Model( const Model& );
	operator void*() const;
	Model& operator=( const Model& );
	void release();
	bool operator==( const Model& ) const;
	bool operator!=( const Model& ) const;
	int referenceCount() const;

	class Impl;
	explicit Model( Impl* );
private:
	Impl* mImpl;
};

//const版
class ConstModel {
public:
	void draw() const;
	const Math::Vector3* position() const;
	const Math::Vector3* angle() const;
	const Math::Vector3* scale() const;
	const Math::Vector3* color() const;
	float transparency() const;

	//以下知らなくていい
	ConstModel();
	ConstModel( const Model& );
	~ConstModel();
	operator void*() const;
	ConstModel& operator=( const Model& );
	void release();
	bool operator==( const Model& ) const;
	bool operator!=( const Model& ) const;
	int referenceCount() const;
private:
	Model mBase;
};

} //namespace Scene
} //namespace NTEngine

#endif // INCLUDED_NTENGINE_SCENE_MODEL_H
